package xhwl.hmo.mall.http.api;


import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.hmo.mall.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by admin on 2017/1/16.
 */

public class AddressInfoApi extends BaseApi {
    AddressInfoReq req;
    public AddressInfoApi(String province_id, String city_id, String district_id){
        req=new AddressInfoReq(province_id,city_id,district_id);
        setShowDialog(true);
        setCancle(true);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).addressInfo(requestBody);
    }
    public class AddressInfoReq {
        private String province_id;
        private String city_id;
        private String district_id;

        public AddressInfoReq(String province_id, String city_id, String district_id) {
            this.province_id = province_id;
            this.city_id = city_id;
            this.district_id = district_id;
        }
    }
}
